1. Field of the Invention
The present invention relates to a tape drive unit and to a recording medium.
2. Description of the Related Art
A so-called xe2x80x9ctape streaming drivexe2x80x9d is known as a drive unit for writing/reading digital data on/from a magnetic tape. This tape streaming drive can have a large recording capacity of, for example, approximately several dozen to several hundred gigabytes, although the capacity varies according to the length of the tape (as a medium) in the tape cassette. Accordingly, the tape streaming drive has various uses, such as a backup of data recorded on a medium such as a hard disk for a computer. The tape streaming drive is suitable for storing image data, which is typically large.
As the above-described tape streaming drive, one that performs data writing/reading by employing a helical scan system using a rotary head and using, for example, an 8-mm videocassette-recorder (VCR) tape cassette as a recording medium, has been proposed.
A tape streaming drive using an 8-mm VCR tape cassette, as described above, uses, for example, a small computer system interface (SCSI) as an input/output interface for data to be written/read.
In the writing mode, data supplied from, for example, a host computer, are input via the SCSI interface. Predetermined compression and encoding processes on the input data are performed and the processed data are recorded on a magnetic tape in a tape cassette.
In the reading mode, the data on the magnetic tape are read and decoded. The decoded data are transmitted to the host computer via the SCSI interface.
In a data storage system composed of the above-described tape streaming drive and tape cassette, when a power cut, etc., occurs due to a blackout or the like while a writing operation to a magnetic tape in the tape cassette (a partition in the case where a plurality of partitions are provided on the magnetic tape) is being performed, the writing operation is incomplete and interrupted. Also, while data erasure or magnetic tape initialization is being performed, the operation is similarly incomplete and interrupted. With respect to FIG. 19, incomplete operations are described. By way of example, a writing operation is considered in which from a point at which data DT (old) is recorded in a partition #m on a magnetic tape (condition (a)), new data DT (new) is written in the partition #m (i.e., data updating).
In this case, writing for data updating is performed as indicated by the arrow Rec (condition (b)). When the operation is interrupted at a point by a power cut, new data DT (new) is half recorded on the magnetic tape (condition (c)), and old data DT (old) remains.
When a tape cassette in which a magnetic tape having condition (c) is loaded into a tape streaming drive, the tape streaming drive reads a mixture of old and new data if the drive is unable to recognize that condition, and the reliability of the storage system greatly deteriorates.
Data writing is performed in units called xe2x80x9cgroups GPsxe2x80x9d (conditions (d) and (e)). When it is assumed that the groups are used as so-called xe2x80x9cerror-correcting unitsxe2x80x9d, if a power cut occurs in the middle of a group GP, that is, when old and new data are mixed in a group GP (condition (e)), appropriate error correction is impossible when reading is performed, so that the tape streaming drive may detect a malfunction.
However, in the case where a power cut occurs at a separating point between two groups GPS, that is, when there is no group GP having a mixture of old and new data (condition (d)), correct error corrections are obtained for all the groups, and the malfunction cannot be detected. In such a case, inappropriate data having a mixture of old and new data is read and sent to a host computer.
In the case where an accidental power cut causes the condition of the data on the magnetic tape to be inappropriate, as described above, there is a problem in that if failing to detect a malfunction, the tape streaming drive subsequently performs wrong data processing, and the system lacks reliability.
Accordingly, it is an object of the present invention to provide a tape drive unit and a tape cassette in which inappropriate operations are prevented by detecting, on a magnetic tape, error caused by a power cut.
To this end, according to an aspect of the present invention, the foregoing object is achieved though provision of a tape drive unit adapted for a tape cassette including a magnetic tape and a memory for writing management information for managing writing on or reading from the magnetic tape. The tape drive unit includes a tape driver for writing/reading information on/from the magnetic tape of the tape cassette when the tape cassette is loaded, a memory driver for writing/reading management information on/from the memory of the loaded tape cassette, and a controller in which when the tape driver executes an operation of writing or erasing information on the magnetic tape, or an operation of initializing the magnetic tape, the controller controls the memory driver to set flags in the management information of the memory to indicate that the operation is being executed, and in which, in accordance with completion of the operation, the controller controls the memory driver to reset the flags.
Preferably, the flags include a first flag, and the controller controls the setting or resetting of the first flag.
The flags may include a second flag for managing each partition on the magnetic tape of the tape cassette, and the controller may control the setting or resetting the second flag in accordance with a partition in which the operation is executed.
When the flags are set for the magnetic tape or a partition on the magnetic tape on which the information writing operation is executed, the controller may inhibit the information writing operation from being executed.
When the flags are set for the magnetic tape or a partition on the magnetic tape on which the information writing operation is executed, the controller may notify a host unit of an error.
According to another aspect of the present invention, the foregoing object is achieved through provision of a recording medium including a magnetic tape and a memory for writing management information for managing writing to or reading from the magnetic tape. The management information of the memory includes a region in which when the tape drive unit executes operation of writing/erasing information on the magnetic tape, or initializing operation, a flag indicating that the operation is being executed is set in the region.
Preferably, the flag is management information for managing the overall magnetic tape.
The flag may be management information for managing each partition on the magnetic tape.